<template>
	<!-- 购买记录 -->
	<view class="page">
		<c-scroll-list :api="api" @load="load">
			<view class="item" v-for="(item,index) in list" :key="index">
				<view class="info">
					<view class="title">开通{{item.title}}会员</view>
					<view class="date">开通时间：{{$fn.parseTime(item.paymentTime)}}</view>
					<view class="date">到期时间：{{$fn.parseTime(item.expireTime)}}</view>
				</view>
				<view class="price">-￥{{item.amount.toFixed(2)}}</view>
			</view>
		</c-scroll-list>
	</view>
</template>

<script>
	export default {
		name: "purchaseRecord",
		data() {
			return {
				num: 100,
				api: this.$api.getOrderList,
				list: []
			};
		},
		onLoad() {},
		onShow() {},
		methods: {
			load(res) {
				console.log('列表', res);
				this.list = res.list
			}
		}
	};
</script>

<style lang="scss" scoped>
	.page {
		padding: 0 32rpx;
		box-sizing: border-box;

		.item {
			padding: 24rpx 0;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #E6E6E6;

			.info {

				.title {
					color: #1A1A1A;
					font-size: 28rpx;
					font-weight: bold;
					margin-bottom: 16rpx;
				}

				.date {
					color: #999999;
					font-size: 20rpx;
				}
			}

			.price {
				color: #EF4630;
				font-size: 32rpx;
			}
		}
	}
</style>